package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysYongyouCgddMapper;
import com.ruoyi.system.domain.SysYongyouCgdd;
import com.ruoyi.system.service.ISysYongyouCgddService;

/**
 * 采购订单Service业务层处理
 * 
 * @author SYF
 * @date 2025-04-18
 */
@Service
public class SysYongyouCgddServiceImpl implements ISysYongyouCgddService 
{
    @Autowired
    private SysYongyouCgddMapper sysYongyouCgddMapper;

    /**
     * 查询采购订单
     * 
     * @param vouchdate 采购订单主键
     * @return 采购订单
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public SysYongyouCgdd selectSysYongyouCgddByVouchdate(String vouchdate)
    {
        return sysYongyouCgddMapper.selectSysYongyouCgddByVouchdate(vouchdate);
    }

    /**
     * 查询采购订单列表
     * 
     * @param sysYongyouCgdd 采购订单
     * @return 采购订单
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public List<SysYongyouCgdd> selectSysYongyouCgddList(SysYongyouCgdd sysYongyouCgdd)
    {
        return sysYongyouCgddMapper.selectSysYongyouCgddList(sysYongyouCgdd);
    }

    /**
     * 新增采购订单
     * 
     * @param sysYongyouCgdd 采购订单
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int insertSysYongyouCgdd(SysYongyouCgdd sysYongyouCgdd)
    {
        return sysYongyouCgddMapper.insertSysYongyouCgdd(sysYongyouCgdd);
    }

    /**
     * 修改采购订单
     * 
     * @param sysYongyouCgdd 采购订单
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int updateSysYongyouCgdd(SysYongyouCgdd sysYongyouCgdd)
    {
        return sysYongyouCgddMapper.updateSysYongyouCgdd(sysYongyouCgdd);
    }

    /**
     * 批量删除采购订单
     * 
     * @param vouchdates 需要删除的采购订单主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteSysYongyouCgddByVouchdates(String[] vouchdates)
    {
        return sysYongyouCgddMapper.deleteSysYongyouCgddByVouchdates(vouchdates);
    }

    /**
     * 删除采购订单信息
     * 
     * @param vouchdate 采购订单主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteSysYongyouCgddByVouchdate(String vouchdate)
    {
        return sysYongyouCgddMapper.deleteSysYongyouCgddByVouchdate(vouchdate);
    }

    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteYongyouCgddByDate(String vouchdate)
    {
        return sysYongyouCgddMapper.deleteYongyouCgddByDate(vouchdate);
    }

    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteYongyouCgddByCode(String code)
    {
        return sysYongyouCgddMapper.deleteYongyouCgddByCode(code);
    }
}
